package com.jeff.grailsstudy.taglib

import java.text.SimpleDateFormat

/*
 * This tag lib is for testing effect only, so make it misc for all purpose
*/
class MiscTagLib {
    def dateFormat = { attrs, body ->
        out << new SimpleDateFormat(attrs.format).format(attrs.value)
    }
    
    def node1 = { attrs, body ->
        pageScope.node1 = "Name-of-Node1"
        out << body()
    }
    
    def node2 = {attrs ->
        out << "I am Node2, my brother is ${pageScope.node1}"
    }
}
